import { Button } from "@/components/ui/button"
import { Copy, Plus, Edit, Trash2 } from "lucide-react"

interface RowCopyButtonsProps {
  onCopyToClipboard?: () => void
  onDuplicateRow?: () => void
  onEdit?: () => void
  onDeleteRow?: () => void
  isCopyRow?: boolean
  copyTooltip?: string
  duplicateTooltip?: string
  editTooltip?: string
  deleteTooltip?: string
}

export function RowCopyButtons({
  onCopyToClipboard,
  onDuplicateRow,
  onEdit,
  onDeleteRow,
  isCopyRow = false,
  copyTooltip = "复制到剪贴板",
  duplicateTooltip = "复制并添加新行",
  editTooltip = "修改",
  deleteTooltip = "删除此行"
}: RowCopyButtonsProps) {
  if (isCopyRow) {
    // 复制行：只显示删除和修改按钮
    return (
      <div className="flex items-center gap-2">
        <Button
          variant="outline"
          size="sm"
          className="flex items-center gap-1 text-red-600"
          onClick={onDeleteRow}
          title={deleteTooltip}
        >
          <Trash2 className="h-3.5 w-3.5" />
          删除
        </Button>
        <Button
          variant="outline"
          size="sm"
          className="flex items-center gap-1 text-primary"
          onClick={onEdit}
          title={editTooltip}
        >
          <Edit className="h-3.5 w-3.5" />
          修改
        </Button>
      </div>
    )
  }
  // 原始行：只显示复制行和修改按钮
  return (
    <div className="flex items-center gap-2">
      <Button
        variant="outline"
        size="sm"
        className="flex items-center gap-1 text-green-600"
        onClick={onDuplicateRow}
        title={duplicateTooltip}
      >
        <Plus className="h-3.5 w-3.5" />
        复制行
      </Button>
      <Button
        variant="outline"
        size="sm"
        className="flex items-center gap-1 text-primary"
        onClick={onEdit}
        title={editTooltip}
      >
        <Edit className="h-3.5 w-3.5" />
        修改
      </Button>
    </div>
  )
} 